import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
Forth_absence = [3, 2, 2, 2, 2, 1.5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Fifth_absence = [3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
Sixth_absence = [2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0.5]
x1 = range(len(Forth_absence))
x2 = range(len(Fifth_absence))
x3 = range(len(Sixth_absence))
plt.figure(figsize=(10, 6))
plt.plot(x1, Forth_absence, marker='o', label='第四周')
plt.plot(x2, Fifth_absence, marker='o', label='第五周')
plt.plot(x3, Sixth_absence, marker='o', label='第六周')
plt.ylabel('缺勤次数')
plt.title('缺勤次数折线图')
plt.legend()
plt.savefig('图像保存3.png')
